home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
tpascal
/
hotmap
/
start.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-03-26
|
4KB
|
140 lines
unit Start;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, VBXCtrl, Hotmap,
Frusamap, David, Ressav, Tool2, Edit, ExtCtrls;
type
TForm1 = class(TForm)
HotMap1: THotMap;
Label1: TLabel;
Label3: TLabel;
Label2: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure HotMap1RegionMouseDown(Sender: TObject;
var RegionNum: Single; var Button: Integer);
procedure HotMap1RegionMouseUp(Sender: TObject; var RegionNum: Single;
var Button: Integer);
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
private
BtnDown: Integer;
FillDemo: Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var DtFl: TVBString;
begin
DtFl := 'START.HMD';
HotMap1.DataFile := DtFl;
HotMap1.Action := 4;
DtFl := 'BTMS.BMP';
HotMap1.BmpName := DtFl;
HotMap1.FillType := 3;
FillDemo := 0;
{ SetStringProp(HotMap1.DataFile, DtFl);}
{ HotMap1.SetStringProp(27, DtFl);}
{ VBXSetPropByName(HotMap1, "DataFile", @DtFl[0], Length(DtFl));}
{ HotMap1.DataFile := BStrPCopy('START.HMD');}
{ SetBStr(HotMap1.DataFile, 'START.HMD');
HotMap1.DataFile := BStrPas('START.HMD');}
end;
procedure TForm1.HotMap1RegionMouseDown(Sender: TObject; var RegionNum: Single; var Button: Integer);
begin
BtnDown := Round(RegionNum);
HotMap1.CurrentRgn := BtnDown;
HotMap1.Action := 1;
end;
procedure TForm1.HotMap1RegionMouseUp(Sender: TObject; var RegionNum: Single; var Button: Integer);
var fmUsaMap: TUsaMap;
fmDavid: TfmDavid;
fmResSav: TfrResSav;
fmTools2: TTools2;
fmEdit: TEditForm;
Rn: Integer;
begin
Rn := Round(RegionNum);
If BtnDown = Rn then
case Rn of
1:
begin
fmUsaMap := TUsaMap.Create(Self);
Self.Hide;
fmUsaMap.ShowModal;
Self.Show;
end;
2:
begin
fmDavid := TfmDavid.Create(Self);
Self.Hide;
fmDavid.ShowModal;
Self.Show;
end;
3:
begin
fmResSav := TfrResSav.Create(Self);
Self.Hide;
fmResSav.ShowModal;
Self.Show;
end;
4:
begin
fmTools2 := TTools2.Create(Self);
Self.Hide;
fmTools2.ShowModal;
Self.Show;
end;
5:
begin
fmEdit := TEditForm.Create(Self);
Self.Hide;
fmEdit.ShowModal;
Self.Show;
end;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
HotMap1.CurrentRgn := (FillDemo);
HotMap1.Action := 1;
FillDemo := FillDemo + 1;
if FillDemo > HotMap1.NumOfRgns + 1 then
begin
HotMap1.CurrentRgn := 0;
HotMap1.Action := 1;
FillDemo := 0;
Timer1.Enabled := False;
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Timer1.Enabled := True;
end;
end.